package eventsocket

import (
	"time"
)

func Nway_get_dtmf(e *Event) string {
	var Dtmf string = ""
	Dtmf = e.Get("DTMF-Digit")
	if Dtmf == "" {
		Dtmf = e.Get("Dtmf-Digit")
	}
	if len(Dtmf) < 1 {
		Dtmf = ""
	}
	return Dtmf
}

func Nway_get_unique_uuid(e *Event) string {
	src_uuid := e.Get("Caller-Unique-ID") //Caller-Unique-Id
	if len(src_uuid) < 1 {
		src_uuid = e.Get("Caller-Unique-Id")
	}
	return src_uuid
}
func Nway_get_other_uuid(e *Event) string {
	tmpstr := e.Get("Other-Leg-Unique-Id")
	if len(tmpstr) < 1 {
		tmpstr = e.Get("Other-Leg-Unique-ID")
	}
	return tmpstr
}

// queue_number
func Nway_get_queue_number(e *Event) string {
	tmpstr := e.Get("Variable_queue_number")
	if len(tmpstr) < 1 {
		tmpstr = e.Get("Variable_Queue_number")
	}
	return tmpstr
}
func Nway_get_src_number(e *Event) string {
	tmpstr := e.Get("Caller-Caller-Id-Number")
	if len(tmpstr) < 1 {
		tmpstr = e.Get("Caller-Caller-ID-Number")
	}
	return tmpstr
}
func Nway_get_sample_queue(e *Event) string {
	tmpstr := e.Get("Variable_sample_queue")
	return tmpstr
}
func Nway_get_destination_number(e *Event) string {
	tmpstr := e.Get("Caller-Destination-Number")
	return tmpstr
}
func Nway_get_direction(e *Event) string {
	tmpstr := e.Get("Call-Direction")
	return tmpstr
}
func Nway_get_aleg_uuid(e *Event) string {
	tmpstr := e.Get("Variable_" + "a_leg_uuid")
	return tmpstr
}
func Nway_get_origination_destination_number(e *Event) string {
	tmpstr := e.Get("Variable_" + "origination_destination_number")
	return tmpstr
}

func Nway_get_callin_ip(e *Event) string {
	tmpstr := e.Get("Caller-Network-Addr")
	return tmpstr
}
func Nway_get_domain(e *Event) string {
	tmpstr := e.Get("Variable_domain_name")
	return tmpstr
}
func Nway_get_gateway(e *Event) string {
	tmpstr := e.Get("Variable_default_gateway")

	return tmpstr
}
func Nway_get_forward_number(e *Event) string {

	tmpstr := e.Get("Variable_sip_history_info")
	return tmpstr
}
func Nway_get_current_time() int64 {
	return time.Now().UnixNano()
}
func Nway_get_term_cause(e *Event) string {
	tmpstr := e.Get("Variable_sip_term_cause")
	return tmpstr
}
func Nway_get_term_status(e *Event) string {
	tmpstr := e.Get("Variable_sip_term_status")
	return tmpstr
}
